<?php
/**
 * @package	Acymailing for Joomla!
 * @version	4.0.1
 * @author	acyba.com
 * @copyright	(C) 2009-2012 ACYBA S.A.RL. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php

class DiagramController extends acymailingController{

	function listing(){
		if(!$this->isAllowed('statistics','manage')) return;
		JRequest::setVar( 'layout', 'listing'  );
		return parent::display();
	}

	function mailing(){
		if(!$this->isAllowed('statistics','manage')) return;
		JRequest::setVar( 'layout', 'mailing'  );
		return parent::display();
	}

	function printnewsletter(){
		JRequest::setVar( 'layout', 'printnewsletter'  );
		acymailing_loadMootools();
		$js = "window.addEvent('domready', function() {setTimeout(function(){window.print()},1000);window.focus();});";
		$doc = JFactory::getDocument();
		$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");
		return parent::display();

	}

}
